# -*- coding: UTF-8 -*-
"""
@Project :xlx-fastapi
@File    :admin_user_proto.py
@Author  :xlx-ali
@Date    :2024/06/24 09:26 星期一
"""

from typing import Optional, Union

from pydantic import BaseModel, Field


class AdminIdentityTokenRequest(BaseModel):
    '''
    账号登录入参
    '''
    username: Optional[str] = Field(default="", description="登录账号", examples=["test"])
    password: Optional[str] = Field(default="", description="登录密码", examples=["test"])
    code: Optional[str] = Field(default="", description="验证码", examples=["test"])


class AdminIdentityTokenListRequest(BaseModel):
    """
    用户列表入参
    """
    id: Optional[int] = Field(default="", description="用户ID", examples=["1"])
    username: Optional[str] = Field(default="", description="登录账号", examples=["test"])
    page: Optional[int] = Field(default=1, description="页", examples=["1"])
    pageSize: Optional[int] = Field(default=10, description="每页数量", examples=["10"])


class AdminIdentityTokenDetailProto(BaseModel):
    """
    详情
    """
    admin_id: int = Field(description="管理员ID")
    token: str = Field(description="token")
    updatetime: int = Field(default=0, description="更新时间")
    expire: int = Field(default=0, description="过期时间")


class AdminIdentityTokenListResponse(BaseModel):
    """
    用户列表出参
    """

    record_total: int = Field(default=0, description="总量")
    record_list: list[AdminIdentityTokenDetailProto] = Field(default=[])


class AdminIdentityTokenResponse(BaseModel):
    '''
    账号登录出参
    '''
    status_code: int = Field(default=0, description="返回状态码")
    token: str = Field(default="", description="返回Token")
    admin_user_info: AdminIdentityTokenDetailProto = Field(default=None, description="账号详情")
